import { defHttp } from '/@/utils/http/axios'

enum OBJ {
  view = '/',
  exportFail = '/exportModelWorkerImportFail',
  importLines = '/getImportRecord',
  failGet = '/getImportFailByImportRecordId',
  failInfo = '/getImportFailByAutoId',
  findVoList = '/findSuccessList',
}

function getApi(url?: string) {
  if (!url) {
    return '/fxcx'
  }
  return '/fscx' + url
}

//列表
export const list = params => {
  return defHttp.get<any>({ url: getApi(OBJ.findVoList), params })
}

//导入记录列表
export const findVoList = (params: Recordable) => {
  return defHttp.get(
    { url: '/fscx/findFailDetailByImport', params },
    {
      isTransformResponse: false,
    }
  )
}



//获取失败数据文件
export const exportFail = params => {
  return defHttp.get<any>(
    {
      url: '/fscx/exportFailDetail',
      params,
      responseType: 'blob',
      timeout: 1800 * 1000
    },
    {
      isTransformResponse: false,
    }
  )
}

export const importLines = params => {
  return defHttp.get<any>({ url: '/fscx/importRecord', params })
}



export const failInfo = params => {
  return defHttp.get<any>({ url: '/fxcxDrjlSbsj/findVoList', params })
}

export const getInfos = params => {
  return defHttp.get<any>({ url: '/fxcxDrjlCgsj/findVoList', params })
}


/**
 * 查分无问题处理
 * @param params 请求参数
 * @returns 
 */
export const updateByGetWycSubmit = params => {
  return defHttp.get<any>(
    { url: '/fscx/fscxWycSubmit', params },
    { isTransformResponse: false }
  )
}

/**
 * 获取查分详情
 * @param params 请求参数
 * @returns 
 */

export const getImportDetail = params => {
  return defHttp.get<any>(
    { url: '/fscx/getImportSuccessDetail', params },
    { isTransformResponse: false }
  )
}

/**
 * 查分有问题处理
 * @param params 请求参数
 * @returns 
 */

export const updateByPostYcSubmit = params => {
  return defHttp.post<any>(
    { url: '/fscx/fscxYcSubmit', params },
    { isTransformResponse: false }
  )
}

export const querySingleDetails = params => {
  return defHttp.get<any>(
    {
      url: '/coreWork/computeKsZdfRealTime4Single',
      params,
    },
    { isTransformResponse: false }
  )
}


export const getNextRowAutoId = params => {
  return defHttp.get<any>(
    {
      url: '/fscx/findNextNotHandleRowThroughAutoId',
      params,
    },
    { isTransformResponse: false }
  )
}


export const getPrevRowAutoId = params => {
  return defHttp.get<any>(
    {
      url: '/fscx/findPrevHandledRowThroughAutoId',
      params,
    },
    { isTransformResponse: false }
  )
}



export const fxcxDrjlCgsjGetByEntity = params => {
  return defHttp.get<any>(
    {
      url: '/fscx/computeKsZdfRealTimeByZkzh',
      params,
    },
    { isTransformResponse: false }
  )
}


export const getMarkingDetailsFun = params => {
  return defHttp.post<any>(
    {
      url: '/coreWork/getZgtPyData4ShowBySubmitId',
      params,
    },
    { isTransformResponse: false }
  )
}


/**
 * 获取考生试题异常列表
 */
export const getKssyycList = params => {
  return defHttp.get<any>({ url: '/coreWork/getYcListByKdkskmId', params })
}


export const getKssyZkzhList = params => {
  return defHttp.get<any>({ url: '/coreWork/getYcListByZkzh', params })
}



export const getWgwjwfList = params => {
  return defHttp.get<any>({ url: '/coreWork/getWgwjwfListByKdkskmId', params })
}


export const getWgwjwfZkzhList = params => {
  return defHttp.get<any>({ url: '/coreWork/getWgwjwfListByZkzh', params })
}


/**
 * 获取机读题的评阅信息
 */

export const getJyxxList = params => {
  return defHttp.get<any>({ url: '/coreWork/getKgtInfo4CheckByStId', params })
}


/**
 * 人工修改客观题答案并归档
 */

export const setUpdateKgt = params => {
  return defHttp.post<any>({ url: '/coreWork/updateKgtAnswerAnd4Save', params })
}

